#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#define INF 0x3f3f3f3f
using namespace std;
struct position{
	int x,y;
}room[5001];
bool vis[5001];
double low[5001];
int n;
double len(int i,int j){
	return sqrt((double)(room[i].x-room[j].x)*(room[i].x-room[j].x)+(double)(room[i].y-room[j].y)*(room[i].y-room[j].y));
}
 
void prim(){
	for(int i=1;i<=n;i++){
		low[i]=len(1,i);
		//cout<<low[i]<<' ';
	}
	low[1]=0;vis[1]=true;
	for(int i=1;i<=n;i++){
		int minn=INF;
		int temp;
		for(int j=1;j<=n;j++){
			//cout<<vis[j]<<' '<<low[j]<<"--"<<endl;
			if(!vis[j]&&minn>low[j]){
				minn=low[j];
				temp=j;
			}
		}
		//cout<<minn<<"--"<<endl;
		vis[temp]=true;
		for(int j=1;j<=n;j++){
			if(!vis[j]&&low[j]>len(temp,j)){
				low[j]=len(temp,j);
			}
		}
	}
}
int main(){
	scanf("%d",&n);
	//cout<<vis[1]<<endl;
	for(int i=1;i<=n;i++){
		scanf("%d%d",&room[i].x,&room[i].y);
	}
	prim();
	double ans=0;
	for(int i=1;i<=n;i++){
		ans+=low[i];
		//cout<<low[i]<<endl;
	}
	printf("%.2lf\n",ans);
}